home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / AppleScript / Additions / GTQ Library 1.2 / Sample Scripts / Play All Sounds < prev    next >
Encoding:
Text File  |  1994-05-03  |  527 b   |  20 lines  |  [TEXT/ToyS]

  1. on fileName(f)
  2.     set oldDelims to AppleScript's text item delimiters
  3.     set AppleScript's text item delimiters to ":"
  4.     set n to the last text item of (f as string)
  5.     set AppleScript's text item delimiters to oldDelims
  6.     return n
  7. end fileName
  8.  
  9. on open f
  10.     set f to f as list
  11.     repeat with i in f
  12.         play every sound in i
  13.         display dialog "There were " & (number of sounds in i) & " sounds in the file " & fileName(f) & "."
  14.     end repeat
  15. end open
  16.  
  17. on run
  18.     choose file with prompt "Choose file to play the sounds from:"
  19.     open result
  20. end run